-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
ref(analytics): Transform analytics events for TET-828 #95208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
- Transform event classes to use @analytics.eventclass decorator - Transform analytics.record calls to use event class instances - Update imports as needed Closes TET-828
❌ 44 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing Fields in Organization Event
The OrganizationCreatedEvent
instance is missing required id
, name
, and slug
fields. Previously, the org
object was passed to analytics.record
, which provided these values. The new event instance only passes actor_id
, omitting these required fields that should be extracted from the org
object, leading to incomplete or failed analytics events.
src/sentry/api/endpoints/organization_index.py#L281-L286
sentry/src/sentry/api/endpoints/organization_index.py
Lines 281 to 286 in 4ece686
analytics.record( | |
OrganizationCreatedEvent( | |
actor_id=request.user.id if request.user.is_authenticated else None, | |
) | |
) |
Bug: Event Constructor Mismatch Causes Error
The AlertCreatedEvent
constructor is incorrectly passed project_id
, referrer
, and session_id
parameters. These fields are not defined in the AlertCreatedEvent
class, leading to a TypeError
when the event is instantiated.
src/sentry/receivers/features.py#L358-L374
sentry/src/sentry/receivers/features.py
Lines 358 to 374 in 4ece686
analytics.record( | |
AlertCreatedEvent( | |
user_id=user_id, | |
default_user_id=default_user_id, | |
organization_id=project.organization_id, | |
project_id=project.id, | |
rule_id=rule_id, | |
rule_type=rule_type, | |
referrer=referrer, | |
session_id=session_id, | |
is_api_token=is_api_token, | |
alert_rule_ui_component=alert_rule_ui_component, | |
duplicate_rule=duplicate_rule, | |
wizard_v3=wizard_v3, | |
query_type=query_type, | |
) | |
) |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Closes TET-828